package com.yitiao.service.ds;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.yitiao.entity.CommerceUser;
import com.yitiao.mapper.CommerceUserMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class UserDsService {

    private final CommerceUserMapper userMapper;

    @DS("slave0")
    public CommerceUser getUserByIdWithDbKey0(String id) {
        return userMapper.selectById(id);
    }

    @DS("slave1")
    public CommerceUser getUserByIdWithDbKey1(String id) {
        return userMapper.selectById(id);
    }
}
